exports.search_node_info = (req, res) => {

  var resultData = {};

  var restfulParams = req.routeInfo.restfulParams;

  //查询审批流程列表
  function searchFlowApproval(cb) {

    R.SEND_HTTP(
      req,
      res,
      {
        url: CORE_APIConfig.coreAPI.flowApprovalSearchInfo.Request_Api_Url + "/ofa_offid/" + restfulParams.ofa_offid + "/ofa_is_delete/0",
        method: 'POST',
        data: {

        }
      },
      function (data) {

        resultData.nodeData = data.result.data;

        cb();

      }
    )

  }

  //查询流程中的子节点信息
  function searchFlowApprovalSonNode(cb){

    F.SerialEach(resultData.nodeData,function(item,index,callback){

      //获取子节点信息
      var sonNodeIds = item.ofa_son_osid.split("|").join(",");


      //根据节点ID查询节点信息
      R.SEND_HTTP(
        req,
        res,
        {
            url: CORE_APIConfig.coreAPI.organizationalStructureSearch.Request_Api_Url + "/in/os_id-" + sonNodeIds + "/sort_order/field(os_id,"+ sonNodeIds +") asc",
            method : 'GET'
        },
        function (data) {        

           
            item.nodeData = data.result.data;

            //拼接节点名称显示
            var sonNodeStr = "";

            for(var i=0;i<item.nodeData.length;i++){
              sonNodeStr+=item.nodeData[i].os_name+" -> "
            }

            item.nodeStr = this.common.takeStrLenth(sonNodeStr,4);

            callback();

        }
      )


    },cb)

  }

  F.Serial([searchFlowApproval,searchFlowApprovalSonNode], () => {

    //将最终结果返回给客户端
    RES.successResponse(res, resultData);

  })

}